home *** CD-ROM | disk | FTP | other *** search
/ Fritz: All Fritz / All Fritz.zip / All Fritz / FILES / WORDMISC / FLYSTEXP.LZH / FLYSTEXP.DOC < prev    next >
Text File  |  2001-01-01  |  19KB  |  364 lines

  1. Introduction (and a little rattling of the cup...)
  2.  
  3.      st/exp represents a new level of performance for text data compression,
  4. typically compressing text files to about 30% of their original size.
  5. However, high throughput is not sacrificed in the process; it is competitive
  6. in speed with the best programs based upon the vastly simpler Limpel-Ziv
  7. algorithm.
  8.  
  9.      I believe it recognizes a point seemingly passed over in all the other
  10. attempts at text data compression that I know of.  Namely, that the pursuit
  11. of ever higher storage capacities without, at the same time, addressing more
  12. convenient information ACCESS, is ultimately a pursuit that will end in
  13. chaos.  The word-orientation of st/exp's compression technique provides the
  14. "hooks" to address exactly this issue of convenient information access.
  15.  
  16.      But, st/exp is not all there is to this package.  There's also what I
  17. consider to be a great little utility, albeit a DIFFERENT little utility,
  18. that takes a lot of the busywork out of word-processing.  I'm using it right
  19. now, along with Microsoft Word, to write this.  It's called Typing Demon.
  20.  
  21.      If you take a little time to understand what it does, I suspect that
  22. you'll like it, too.  If you just jump into it, it will probably beep at you
  23. a lot, and you'll probably find it weird and frustrating.  It's really not
  24. that difficult to get used to.  Getting used to not having it, if someone
  25. shoves you onto a VAX or something, would be more difficult.
  26.  
  27.      There's also a nice directory program, as well as a number of other
  28. programs which, likely as not, duplicate programs you already have.
  29.  
  30.      If you find these programs useful, a contribution of $25 will be
  31. greatly appreciated.  For $50, you will be registered and will receive the
  32. next program update, with manual, at no additional cost.  Quantity discounts
  33. and site licensing can be worked out for anyone that gets really serious
  34. about it.
  35.  
  36.      st/exp was definitely NOT a hobbyist effort.  I'm trying to do this for
  37. a living.  With your support, Bartles and James has been able to bring you
  38. an ever-expanding array of different-flavored wine coolers.  Also with your
  39. support, I will be able to continue to develop this basic technology into
  40. something that will be even more useful and interesting, which will
  41. ultimately save YOU money!  You can send your INVESTMENT to:
  42.  
  43.      MicroComputer Square
  44.      126 Hancock Avenue
  45.      Spartanburg, SC  29302
  46.  
  47. and THANKS!!!
  48.  
  49.  
  50.      PLEASE NOTE that your contribution entitles you to ALL of the programs
  51. listed below, even though the package may be broken up in archives named
  52. fly_util.arc, flydemon.arc, and flystexp.arc, to allow downloading in smaller
  53. "bytes".
  54.  
  55.  
  56. Now the Manual
  57.  
  58. The following programs and files should be found on the distribution disks:
  59.  
  60. ask_demo.bat  -- provides a demonstration of the ask program
  61. ask.exe       -- a UNIX-style utility for use in batch files
  62. d.exe         -- a directory program you'll like
  63. hide.exe      -- changes the attribute of the specified file to "hidden"
  64. hunt.exe      -- a file-name finder utility
  65. look4.exe     -- searches for any file containing a specified text string
  66. mc2sp.exe     -- Installs MicroComputer Square's sexy prompt
  67. newdate.exe   -- changes the file date/time of the specified files
  68. unhide.exe    -- changes the attribute of the specified file to "normal"
  69. volname.exe   -- allows you to name/rename a disk (hard or floppy) volume
  70.  
  71. All of the above programs provide at least minimal instruction as to how to
  72. run them, simply by typing their program name (followed by return).  One
  73. exception is mc2sp, which simply does its thing (which is to write a prompt
  74. command to your autoexec file).  The other exception is d, our directory
  75. program.  d will provide rather complete help, by typing "d h", or "d ?".
  76.  
  77. These files are in the directory "DEMON"
  78.  
  79. demon.exe     -- the Typing Demon program
  80. linguist.exe  -- a vocabulary-analysis program for use with Typing Demon
  81. mk_demon.exe  -- a "compiler" program to generate your own list of demons
  82.                    and abbreviations for use with Typing Demon
  83. setdemon.exe  -- configures Typing Demon according to its options
  84.  
  85. demons.fly    -- the compiled distribution "demons file" for fanatics
  86. template.fly  -- the ASCII source file for the above
  87. demons.qwe    -- the compiled demons file for the QWERTY keyboard
  88. template.qwe  -- the ASCII source file for the above
  89.  
  90. As above, most of these programs provide some minimal help by typing their
  91. program name.  The Typing Demon program, however, simply installs itself in
  92. memory when its name is typed.
  93.  
  94. These files are in the directory "STEXP"
  95.  
  96. st.exe        -- the FlySpeed compression program
  97. exp.exe       --  "     "     expansion program
  98. flyspeed.mc2  -- FlySpeed's dictionary data file
  99.  
  100. st/exp will tell you that you need to specify a file-specification, if you
  101. simply type their program name, followed by return.
  102.  
  103.  
  104. st/exp
  105.  
  106.      st/exp (es-tee-e-x-p) is really a pair of programs: st.exe, which
  107. compresses text files (we had to call it something, so we called it "stomp",
  108. or "st" for short), and exp.exe (short for "expand"), which re-expands the
  109. compressed file to an identical copy of the original.  By "text", we mean
  110. the normal output of word-processing programs, preferably saved in a stan-
  111. dard ASCII format (as is usually done for telecommunications use).  Eventu-
  112. ally, the program should be able to reliably compress database files as well
  113. (and maybe spreadsheet files a little later), but for now we intend to
  114. concern ourselves with compression of written language, which is actually a
  115. more difficult problem that really has not been adequately addressed, until
  116. now.
  117.  
  118. How It Works
  119.  
  120.      Well, we can't entirely say, since some aspects of the program's opera-
  121. tion constitute patentable processes, and the patent application hasn't been
  122. filed yet.  Beyond that, the program simply doesn't work by any one simple
  123. "trick" or "scheme"; it is actually a collection of algorithms, some novel
  124. and wretchedly complex, with an efficient means of determining the best
  125. algorithm to use for the data immediately being examined.  For example, the
  126. well-known (in computing circles) run-length-limited representation is used
  127. to optimally represent situations in which a particular character is repeat-
  128. ed a number of times, such as a long sequence of spaces.  We expect that the
  129. program will eventually be able to compress database files quite well, since
  130. spaces or "null characters" are often employed as fill characters for "empty
  131. fields" in database files, and these sequences can be compressed to just
  132. about nothing using a run-length representation.  Compression of true text
  133. data, which is to say written language in a digital form, is not so easily
  134. accomplished, unfortunately.
  135.  
  136.      (Those of you who are particularly interested in compression of data-
  137. base and spreadsheet files should make your interests known to us.  We would
  138. especially appreciate any actual dBase II and Lotus files you care to send
  139. us, since lack of actual data to use for tests is one of the most serious
  140. impediments to the development and refinement of that capability.)
  141.  
  142.      We have described Fly Coding as an "optimal representation of lan-
  143. guage", implicitly meaning "an optimal digital representation of written
  144. language", including punctuation, etc.  The use of the word "optimal" na-
  145. turally begs the question, "Optimal in what sense?", or "What parameter or
  146. parameters are being optimized?"
  147.  
  148. A Real-Quick Tutorial on Digital Data Storage
  149.  
  150.      Computer people like to talk in terms of bits and bytes.  A BIT is a
  151. Binary digIT, which can be either a 0 or a 1, easily represented electron-
  152. ically as a low (less than 1 Volt) or high (more than 3 Volts) voltage.
  153. Since a bit is so little (it takes about 10 to make the equivalent of 3
  154. normal, base-10 digits), a byte (which is 8 bits) is generally more conven-
  155. ient to talk about.
  156.  
  157.      A byte can represent 2-to-the-power-of-8, or 256, different values, and
  158. may thus be thought of as a digit, base-256, or by "hexadecimal" notation:
  159. two digits, base-16.
  160.  
  161.      If, say, the Declaration of Independence, stored as a normal text file,
  162. contained 10,000 bytes, then, in effect, we are using a 10,000 digit number,
  163. base-256, to represent the information contained in the Declaration of
  164. Independence (a number vastly larger than the number of subatomic particles
  165. in the universe).  This would be exactly equivalent to 20,000 digits, base-
  166. 16, and approximately 24,000 digits, base-10 (since "5 digits", 100,000
  167. base-16, is 1,048,576 or about "6 digits", base-10).
  168.  
  169.      What we would like to do is to find a number with significantly fewer
  170. digits which can represent the same information, thereby reducing the space
  171. required to store the number, whether we are storing it on a piece of paper,
  172. or a magnetic or optical disk (and also reducing the time it will take to
  173. transmit the number by modem).  If we can reduce the number of digits needed
  174. by a factor of 4, then, in effect, we are transforming the number into a
  175. second number which is approximately the fourth root of the first (we must,
  176. of course, be able to transform the second number identically back into the
  177. first).
  178.  
  179.      We would like to say that, in producing an "optimal representation of
  180. language", we have found a way of finding the minimum number which can
  181. represent a given document.  We think we can make this statement, with the
  182. qualification that the technique should not resort to natural-language
  183. comprehension in order to perform the compression.
  184.  
  185.      This qualification hints at the other parameters which are of concern:
  186. namely, the speed at which the process operates, as well as its memory
  187. requirements, reliability, and certainly the feasibility of accomplishing
  188. the desired goal before starvation set in.  In other words, what is being
  189. optimized is the USEFULNESS of the technique, which is a more subtle issue
  190. than just optimizing the compression factor.  Nonetheless, we feel that we
  191. were able to avoid all, but a few minor compromises between high compression
  192. factor and high throughput.
  193.  
  194. But How Does It Work?
  195.  
  196.      In order to discuss "how it works" adequately, some discussion of "what
  197. information is", from an epistemological perspective, is in order.  But
  198. since we've probably already lost some of you, we'd really rather not go
  199. into that...
  200.  
  201.      However, an explanation that we think will satisfy a lot of people, and
  202. which really does explain much of how the program works, is simply this:
  203.  
  204.      The program uses a "dictionary", contained in the file "flyspeed.mc2",
  205. to convert words found in a document to numbers, which take up less room
  206. than the original word, as represented according to the standard convention.
  207.  
  208.      The dictionary, itself, employs data-compression techniques, as do the
  209. dictionaries used in spelling checkers that come with most word-processing
  210. packages.  The difference is that, while the data-compression techniques
  211. employed in common spelling checkers are oriented toward anachronistic
  212. concerns over saving memory, the data-compression techniques employed in
  213. FlySpeed's dictionary are geared toward high-speed lookup.  It is for this
  214. reason that FlySpeed's "tokenizing engine" runs from 19 (Wordperfect) to 115
  215. (Borland's Turbo Lightning) times faster than typical spelling checkers on
  216. the market.
  217.  
  218.      A writer of an ad which appeared recently in a major personal-computing
  219. publication, for a board which compresses database files, had "cutesie"
  220. compression programs mashing, mangling, and otherwise doing terrible things
  221. to data.  (We're not sure what's so different about having the micropro-
  222. cessor on your computer's motherboard do the compression, from having a
  223. microprocessor on a plug-in board, if you have any plug-in slots left... do
  224. it.)  It fairly well pointed up the fact that most people haven't got a clue
  225. as to what data-compression really means.
  226.  
  227.      In a nutshell, data-compression simply means finding a more efficient
  228. representation of data than the representation commonly in use, and being
  229. able to translate back and forth between the two.  There is usually nothing
  230. which intrinsically recommends "the representation commonly in use", other
  231. than simplicity and expediency.  We feel that, given the power and sophis-
  232. tication of modern microcomputers, simplicity and expediency no longer
  233. constitute sufficient justification for the use of ASCII (American Standard
  234. Code for Information Interchange), at least not for the purposes of infor-
  235. mation storage and communication.  Furthermore, as businesses are beginning
  236. to build up megabytes of records and documents on their computers, there is
  237. a need not only to address efficient information storage and communication,
  238. but efficient information retrieval, as well.
  239.  
  240. Running st/exp
  241.  
  242.      st and exp must be run from the directory in which they are located
  243. (you can't simply put them in some directory named in a "path command", and
  244. then run them from whatever directory you happen to be in).
  245.  
  246.      We could eliminate this restriction, and we'll do so if people scream
  247. for it, but the programs load somewhat faster when DOS doesn't have to look
  248. very far for them.  For short documents, the time it takes DOS simply to
  249. load st/exp, can be a significant portion of the program's "run time".
  250.  
  251.      Besides, you'll compress files after you've finished creating them, at
  252. which time you'll probably be in your word-processing directory, so your
  253. word-processing directory is the logical place to put st/exp.
  254.  
  255. In order to compress a file, simply type:
  256.  
  257.      st filename
  258.  
  259. More generally, you can type:
  260.  
  261.      st filespec1 ... filespecN
  262.  
  263. in order to compress all files having those file-specifications.  For
  264. example, you would type :
  265.  
  266.      st \mary\*.doc john\*.txt gossip?.*
  267.  
  268. in order to compress all files in the directory "mary", having the extension
  269. "doc"; all files in the subdirectory "john", of the current directory, hav-
  270. ing the extension "txt", as well as all files in the current directory with
  271. any extension, and whose first six characters are "gossip".
  272.  
  273.      Expansion works in a similar fashion; however, exp always looks for
  274. files having a "prs" extension (which is the extension assigned by st to its
  275. compressed output file).  Thus, in order to expand the files above, you
  276. would type:
  277.  
  278.      exp \mary\* john\* gossip?
  279.  
  280.      By September '88, we expect to provide an option by which Typing Demon
  281. can automatically compress your files when you leave your word-processor.
  282. We will also provide an archive capability, wherein many documents are
  283. packed into a single large file.  (When DOS stores a file, it stores it in
  284. an integral number of "clusters" of disk-sectors.  A common cluster size for
  285. hard-disks is 16 sectors, or 8192 bytes, so that up to 8191 bytes are wasted
  286. when DOS stores a file.)  This archive capability will also be important for
  287. our text-retrieval program, Merlin, which will allow you to access files by
  288. any word, or combination of words, in the archive.
  289.  
  290.  
  291. A Nasty Footnote about Microsoft Word
  292.  
  293.      We hope this isn't going to get to be a regular thing with Microsoft
  294. Word, but, as with Typing Demon, we need to add a footnote...
  295.  
  296.      If you get out your calculator and divide the file-size of your Word
  297. documents by 512, you'll always end up with an integer.  This is not due to
  298. some great coincidence of the Cosmos.  Since the sector size used by IBM PCs
  299. is 512 bytes, they may have decided that it doesn't "hurt anything" to do
  300. this.  Even if you plan to transmit the document by modem, with a 1200 baud
  301. modem, it would take only about an extra 4 seconds to transmit the maximum
  302. 511 bytes of unnecessary junk left at the end of the file.
  303.  
  304.      However, since st/exp is not at liberty to decide what in a file is and
  305. is not important, when it encounters this junk, it must faithfully deal with
  306. it.  This can have a disproportionate impact in the compression one may
  307. achieve with Microsoft Word files, particularly for files with perhaps only
  308. 1000 words, and 511 bytes of junk at the end.
  309.  
  310.      One solution is to store your Word documents on disk in the standard
  311. ASCII format, by setting the printer to "plain", and printing to a file as
  312. described in the Word manual.  You may need to do this anyway, if you are
  313. sending electronic mail to someone who doesn't have Microsoft Word.  How-
  314. ever, Word is not especially fast at saving documents in text form.
  315.  
  316.      The best solution, which is out of your hands as well as ours, is for
  317. Microsoft to set the file-size to its real value, or, at least, set all the
  318. junk to spaces or nulls.
  319.  
  320.      Where all this junk comes from, this writer isn't entirely certain.  I
  321. noticed once, that one Word file I'd just written had junk from a previous
  322. file I'd been working on, which suggests that the junk is simply whatever
  323. happened to be in some particular section of memory when the file was saved.
  324.  
  325.      So, if you're using Microsoft Word to write some electronic mail to
  326. someone you and a co-conspirator are planning to murder, and you're also
  327. writing to your co-conspirator, write your letter to your co-conspirator
  328. AFTER you write the letter to your intended victim.
  329.  
  330.      Conversely, if you suspect that someone is conspiring to murder you,
  331. and you get some electronic mail from them written with Word, type the file
  332. to the screen to display any junk which might be at the end.  It may just
  333. contain a fragment of some mail written previously to their co-conspirator,
  334. which may give their plan away, and provide evidence for the authorities.
  335.  
  336.      In addition to this junk at the end of a Word file, there is also a
  337. 128-byte header at the beginning of Word files, which appears to contain
  338. useful information (at least useful to Word itself), such as what the right-
  339. hand margin setting for the file is.  Of course, having to deal with this
  340. non-language information also can hurt the compression attainable with
  341. Microsoft Word, though it doesn't cause that much of a problem for longer
  342. files.
  343.  
  344.  
  345. Installation
  346.  
  347.      Most FlySpeed programs are programs you will want to run without
  348. actually having to be in the directory in which they are located.  I have
  349. two subdirectories, one named "dos" and the other named "batch", which I
  350. have made "globally visible" (I can invoke the programs and batch files in
  351. them no matter what the current subdirectory may be) by means of a path
  352. command (see your DOS manual if you don't know what that is).  I think it
  353. would be just as good to lump them all together in a directory named
  354. "global", for that matter.  Listed below is the recommended place to put the
  355. various programs, where "global" means some directory which is normally
  356. included in a path command (which you will probably have in your
  357. autoexec.bat file).
  358.  
  359. In the directory "STEXP" ...
  360.  
  361. st            -- Probably in your word-processing directory.
  362. exp           -- ditto.
  363. flyspeed.mc2  -- ditto.
  364.